<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            margin:0;
        }
        .base{
            position: absolute;
            left:0;
            top:0;
            width:390px;
            height:200px;
            display: flex;
            justify-content: center;
            align-items: center;
            
            background-color: yellow;
        }
        .head{
            position: absolute;
            left:0;
            top:0;
            width:390px;
            height:200px;
            background-color: red;
            /* border:1px solid red; */
            display: flex;
            justify-content: center;
            align-items: center;
        }
    </style>
</head>
<body>
    <div class="base">
        <a href="https://www.baidu.com">百度</a>
    </div>
    <div class="head">
        <input id="btn" type="button" value="确定">
    </div>
    <script>
        
        // document.getElementById("btn").onclick = function(){
        //     console.log("hello");
        // };
        document.getElementById("btn").onclick = function(){
            console.log("hello");
            document.querySelector(".head").style.display = "none";
        }
    </script>
</body>
</html>